#!/usr/bin/python
# -*- coding: utf-8 -*-
# File: vazaar.py
# Author: Tomás Vírseda
# License: GPL v3
# Description: setup vazaar environment. Launch application

"""
Vazaar Entry Point
"""

import sys
import os
import os.path

from bin.utils import get_logger

# Find out the location of vazaar's working directory,
# and insert it to sys.path
BASEDIR = os.path.dirname(os.path.realpath(__file__))
if not os.path.exists(os.path.join(BASEDIR, "vazaar.py")):
    CWD = os.getcwd()
    if os.path.exists(os.path.join(CWD, "vazaar.py")):
        BASEDIR = CWD
LIBDIR = BASEDIR + "/bin"

sys.path.insert(0, LIBDIR)
sys.path.insert(0, BASEDIR)

vlog = get_logger("Vazaar")

def start():
    """
    Start Vazaar
    """

    from bin.main import Vazaar

    vlog.info("Starting Vazaar...")
    Vazaar()

if __name__ == "__main__":
    start()
    vlog.info("See you soon")
    sys.exit(0)
# vim: et sts=4 sw=4
